<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../react18/react.development.js"></script>
    <script src="../react18/react-dom.development.js"></script>
    <script src="../react18/babel.min.js"></script>
</head>

<body>
    <div id="app"></div>
    <script type="text/babel">
        /*
         非组件定义,而是一个封装函数返回虚拟DOM

         缺点:
             -识别性不高,一般组件的调用使用大写的标签</Title>
             -非组件定义不具备组件拥有的功能(hooks等)
             -开发者工具也不会识别
        */
        function Title(){
            return <h1>标题</h1>
        }

        const root = ReactDOM.createRoot(document.getElementById("app"))
        root.render(Title())


    </script>
</body>

</html>